import { defineStore } from 'pinia';
import { ContractListItemType } from '@/api/contract';

interface signatureState {
  doctorInfo: Nullable<ContractListItemType>;
}

export const useDoctorStore = defineStore({
  id: 'app-signature',
  state: (): signatureState => ({
    // doctor info
    doctorInfo: null,
  }),
  getters: {
    getDoctorInfo(state): ContractListItemType {
      return state.doctorInfo || {} as any
    },
  },
  actions: {
    setDoctorInfo(info: ContractListItemType | null) {
      this.doctorInfo = info;
    },
    resetState() {
      this.doctorInfo = null;
    },
  },
});
